home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow / Editing / StillCap / StillCap.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-09  |  2.7 KB  |  88 lines

  1. //------------------------------------------------------------------------------
  2. // File: StillCap.cpp
  3. //
  4. // Desc: DirectShow sample code - C++ application that uses the 
  5. //       ISampleGrabber interface to capture still images to a .bmp
  6. //       file on disk from a live capture stream.  It demonstrates
  7. //       how to get the bits back from it in real time via a callback.
  8. //
  9. // Copyright (c) 1999-2001 Microsoft Corporation.  All rights reserved.
  10. //------------------------------------------------------------------------------
  11.  
  12.  
  13. #include "stdafx.h"
  14. #include "StillCap.h"
  15. #include "StillCapDlg.h"
  16.  
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CStillCapApp
  25.  
  26. BEGIN_MESSAGE_MAP(CStillCapApp, CWinApp)
  27.     //{{AFX_MSG_MAP(CStillCapApp)
  28.         // NOTE - the ClassWizard will add and remove mapping macros here.
  29.         //    DO NOT EDIT what you see in these blocks of generated code!
  30.     //}}AFX_MSG
  31.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  32. END_MESSAGE_MAP()
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CStillCapApp construction
  36.  
  37. CStillCapApp::CStillCapApp()
  38. {
  39.     // TODO: add construction code here,
  40.     // Place all significant initialization in InitInstance
  41. }
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // The one and only CStillCapApp object
  45.  
  46. CStillCapApp theApp;
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CStillCapApp initialization
  50.  
  51. BOOL CStillCapApp::InitInstance()
  52. {
  53.     AfxEnableControlContainer();
  54.  
  55.     // Standard initialization
  56.     // If you are not using these features and wish to reduce the size
  57.     //  of your final executable, you should remove from the following
  58.     //  the specific initialization routines you do not need.
  59.  
  60. #ifdef _AFXDLL
  61.     // In MFC 5.0, Enable3dControls and Enable3dControlsStatic are obsolete because
  62.     // their functionality is incorporated into Microsoft's 32-bit operating systems.
  63. #if (_MSC_VER <= 1200)
  64.     Enable3dControls();            // Call this when using MFC in a shared DLL
  65. #endif
  66. #else
  67.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  68. #endif
  69.  
  70.     CStillCapDlg dlg;
  71.     m_pMainWnd = &dlg;
  72.     int nResponse = (int) dlg.DoModal();
  73.     if (nResponse == IDOK)
  74.     {
  75.         // TODO: Place code here to handle when the dialog is
  76.         //  dismissed with OK
  77.     }
  78.     else if (nResponse == IDCANCEL)
  79.     {
  80.         // TODO: Place code here to handle when the dialog is
  81.         //  dismissed with Cancel
  82.     }
  83.  
  84.     // Since the dialog has been closed, return FALSE so that we exit the
  85.     //  application, rather than start the application's message pump.
  86.     return FALSE;
  87. }
  88.